package com.xx.ch05.text.text02;

/**
 * @author 许欣
 * 时间：2022/4/11 15:19
 * 描述：
 */
public class Printer {
    private Ink ink=null;
    private Paper paper=null;

    /**
     * 打印方法
     * @param message
     */
    public void print(String message){
        //输出颜色到纸张
        System.out.println("使用"+ink.getColor(255,200,0)+"颜色打印：\n");

        for (int i=0;i<message.length();i++){
            paper.putInChar(message.charAt(i));
        }
        //将纸张的内容输出
        System.out.println(paper.getContent());
    }

    public Ink getInk() {
        return ink;
    }

    public void setInk(Ink ink) {
        this.ink = ink;
    }

    public Paper getPaper() {
        return paper;
    }

    public void setPaper(Paper paper) {
        this.paper = paper;
    }
}
